//
//  RVPurseController.swift
//  AirTravel
//
//  Created by apple on 2021/11/15.
//

import UIKit
import ESPullToRefresh
class RVPurseController: CommonVC {
    @IBOutlet weak var restLabel: UILabel!
    
    @IBOutlet weak var totalLabel: UILabel!
    
    
    @IBOutlet weak var tableView: UITableView!
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        head.title.text = "钱包"
        confTableView()
    }
    
    
    
    func confTableView(){
        tableView.register(UINib(nibName: "RVPurseListCell", bundle: nil), forCellReuseIdentifier: "purse_list")
        tableView.rowHeight = 70
        tableView.reloadData()
    }


    @IBAction func clickOutBtn(_ sender: Any) {
        let vc = RVChargeController(type: .withdraw)
        navigationController?.pushViewController(vc, animated: true)
        
    }
    
    @IBAction func clickRechargeBtn(_ sender: Any) {
        let vc = RVChargeController(type: .recharge)
        navigationController?.pushViewController(vc, animated: true)
    }
    
}

extension RVPurseController: UITableViewDelegate, UITableViewDataSource{
    
    
    func numberOfSections(in tableView: UITableView) -> Int {
        return 1
    }
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 6
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "purse_list", for: indexPath) as! RVPurseListCell
        return cell
        
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: true)
    }
}
